﻿using System;

namespace DecoratorDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            // Demo1();
            Demo2();
        }

        private static void Demo2()
        {
            IDecorator decorator = DecoratorFactory.CreateBeDecorator<BeDecorator>("jack");
            string result = decorator.Decorate();
            Console.WriteLine(result);
        }

        private static void Demo1()
        {
            IDecorator decorator = new BeDecorator("jack");
            decorator = new Decorator1(decorator);
            decorator = new Decorator2(decorator);
            decorator = new Decorator3(decorator);
            string result = decorator.Decorate();
            Console.WriteLine(result);
        }
    }
}
